#include<iostream>
#include<vector>
#include<string>
using namespace std;
class Solution {
public:
    vector<vector<int>> generate(int numRows)
    {
        vector<vector<int>> vv;
        vv.resize(numRows);
        int i = 0;
        for (i = 0; i < numRows; i++)
        {
            vv[i].resize(i + 1, 0);
            vv[i].front() = vv[i].back() = 1;
        }

        for (i = 0; i < numRows; i++)
            for (int j = 0; j < vv[i].size(); j++)
            {
                if (vv[i][j] == 0)
                {
                    vv[i][j] = vv[i - 1][j] + vv[i - 1][j - 1];
                }

            }

        return vv;

    }
};

int main()
{
    Solution obj;
    obj.generate(5);
    return 0;
}